package com.xhu.water_supply.utils;

import java.util.Locale;
import java.util.UUID;

/**
 * UUID工具类
 */
public class UUIDUtils {

    /**
     * 返回一个没有中划线的32位字符串
     * @return
     */
    public static String getUUID32(){
        return UUID.randomUUID().toString().replace("-","");
    }

    public static String getUUID32(String sep){
        return UUID.randomUUID().toString().replace("-", sep);
    }

    public static String getRandomCodeUpper(){
        return getUUID32("-").substring(19, 23).toUpperCase(Locale.ROOT);
    }

    public static void main(String[] args) {
        System.out.println(getUUID32("-").substring(19, 23));
    }
}
